import type { RouteRecordStringComponent } from '@vben/types';

import { requestClient, baseRequestClient } from '#/api/request';

// 获取用户所有菜单
export async function getAllUserMenu() {
  return requestClient.get<RouteRecordStringComponent[]>(
    '/ChargeSystem/demo/selectInfo',
  );
}
// 获取公司树数据
export async function getCompanyTree() {
  return baseRequestClient.get<RouteRecordStringComponent[]>(
    '/ChargeSystem/person/companyTree',
  );
}
// 添加子公司
export async function addSubCompany(data: any) {
  return baseRequestClient.post<RouteRecordStringComponent[]>(
    '/ChargeSystem/level/saveCompany',
    data,
  );
}
// 修改公司名称
export async function updateCompanyName(data: any) {
  return baseRequestClient.post<RouteRecordStringComponent[]>(
    '/ChargeSystem/level/updateCompany',
    data,
  );
}
// 删除公司
export async function deleteCompany(id: number) {
  return baseRequestClient.get<RouteRecordStringComponent[]>(
    '/ChargeSystem/level/deleteCompany/?id=' + id,
  );
}
